﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace Cheems.Control.Controls
{
    public class LoginCard : UserControl
    {

        /// <summary>
        /// 用户输入的用户名
        /// </summary>
        public string UserName
        {
            get { return (string)GetValue(UserNameProperty); }
            set { SetValue(UserNameProperty, value); }
        }
        public static readonly DependencyProperty UserNameProperty =
            DependencyProperty.Register("UserName", typeof(string), typeof(LoginCard), new PropertyMetadata(string.Empty));



        /// <summary>
        /// 用户名列表
        /// </summary>
        public ObservableCollection<string> UserNameList
        {
            get { return (ObservableCollection<string>)GetValue(UserNameListProperty); }
            set { SetValue(UserNameListProperty, value); }
        }
        public static readonly DependencyProperty UserNameListProperty =
            DependencyProperty.Register("UserNameList", typeof(ObservableCollection<string>), typeof(LoginCard), new PropertyMetadata(new ObservableCollection<string>()));


        /// <summary>
        /// 用户输入的密码
        /// </summary>
        public string Password
        {
            get { return (string)GetValue(PasswordProperty); }
            set { SetValue(PasswordProperty, value); }
        }
        public static readonly DependencyProperty PasswordProperty =
            DependencyProperty.Register("Password", typeof(string), typeof(LoginCard), new PropertyMetadata(string.Empty));


        public static readonly DependencyProperty LoginCommandProperty = DependencyProperty.Register(
            "LoginCommand", typeof(ICommand), typeof(LoginCard), new PropertyMetadata(null));
        /// <summary>
        /// 用户登录
        /// </summary>
        public ICommand LoginCommand
        {
            get { return (ICommand)GetValue(LoginCommandProperty); }
            set { SetValue(LoginCommandProperty, value); }
        }
    }
}
